﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Threading;

namespace TamilManam
{
    public partial class Page2 : PhoneApplicationPage
    {
        public Page2()
        {
            InitializeComponent();
            _countdown = 2;
            _timer = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += (s, e) => Tick();
            _timer.Start();
        }
        private DispatcherTimer _timer;
        private int _countdown;
        private void Tick()
        {
            _countdown--;

            if (_countdown == 0)
            {
                _timer.Stop();
                NavigationService.Navigate(new Uri("/mainPage.xaml", UriKind.Relative));
            }
        }


    }
}